<?php

namespace PhpYes\Com;

class ExtName
{
    /**
     * last extension name
     * 'hello.JS.ERB' => 'ERB'
     * '.' => ''
     * '..' => ''
     * '.hello' => ''
     * 'hello.' => ''
     * ----------
     * $ext = self::ext($path, $is_locale);
     * lower_ext = isset($ext) ? strtolower($ext) : '';
     * ----------
     * @param string $path - only path, no ?query no #hash, 仅仅只有 path, 没有 ?query 没有 #hash
     * @param bool $is_locale - $path is locale path
     * @return string - 原封不动地返回扩展名，不包括点(.), 也不转换大小写，例如 x.hTmL 返回 hTmL
     */
    public static function ext($path, $is_locale = false)
    {
        $path = empty($path) ? '' : trim($path);
        if (empty($path)) {
            return '';
        }
        $len = strlen($path);
        if ($len < 3) { // strlen(p.e) >= 3
            return '';
        }

        // false : 表示没有扩展名，0 : 表示隐藏文件，$len - 1 : 表示最后一个字符
        $dot_idx = false;
        $base_idx = 0;
        $end_idx = $len - 1;
        if ($is_locale) {
            for ($i = $end_idx; $i > 0; $i--) {
                $c = $path[$i];
                if ($c === '.') {
                    if (empty($dot_idx)) {
                        $dot_idx = $i;
                    }
                } elseif ($c === '/' || $c === DIRECTORY_SEPARATOR) {
                    $base_idx = $i + 1;
                    break;
                } elseif ($dot_idx) {
                    break;
                }
            }
        } else {
            for ($i = $end_idx; $i > 0; $i--) {
                $c = $path[$i];
                if ($c === '.') {
                    if (empty($dot_idx)) {
                        $dot_idx = $i;
                    }
                } elseif ($c === '/') {
                    $base_idx = $i + 1;
                    break;
                } elseif ($dot_idx) {
                    break;
                }
            }
        }
        if (empty($dot_idx)) {
            return '';
        }
        return $base_idx < $dot_idx && $dot_idx < $end_idx ? substr($path, $dot_idx + 1) : '';
    }

    /**
     * last lower case extension name
     * 'hello.JS.ERB' => 'erb'
     * @param string $path - only path, no ?query no #hash, 仅仅只有 path, 没有 ?query 没有 #hash
     * @param bool $is_locale - $path is locale path
     * @return string
     */
    // public static function lower_ext($path, $is_locale = false)
    // {
    //     $ext = self::ext($path, $is_locale);
    //     return isset($ext) ? strtolower($ext) : '';
    // }

    /**
     * last dot extension name
     * 'hello.JS.ERB' => '.ERB'
     * '.' => ''
     * '..' => '.'
     * '.hello' => ''
     * 'hello.' => '.'
     * ----------
     * $dot_ext = self::dot_ext($path, $is_locale);
     * lower_dot_ext = empty($dot_ext) ? '' : strtolower($dot_ext);
     * ----------
     * @param string $path - only path, no ?query no #hash, 仅仅只有 path, 没有 ?query 没有 #hash
     * @param bool $is_locale - $path is locale path
     * @return string - 原封不动地返回扩展名，包括点(.), 不转换大小写，例如 x.hTmL 返回 .hTmL
     */
    public static function dot_ext($path, $is_locale = false)
    {
        $path = empty($path) ? '' : trim($path);
        if (empty($path)) {
            return '';
        }
        $len = strlen($path);
        if ($len < 2) { // strlen(p.) >= 2
            return '';
        }

        $dot_idx = false;
        $base_idx = 0;
        if ($is_locale) {
            for ($i = $len - 1; $i > 0; $i--) {
                $c = $path[$i];
                if ($c === '.') {
                    if (empty($dot_idx)) {
                        $dot_idx = $i;
                    }
                } elseif ($c === '/' || $c === DIRECTORY_SEPARATOR) {
                    $base_idx = $i + 1;
                    break;
                } elseif ($dot_idx) {
                    break;
                }
            }
        } else {
            for ($i = $len - 1; $i > 0; $i--) {
                $c = $path[$i];
                if ($c === '.') {
                    if (empty($dot_idx)) {
                        $dot_idx = $i;
                    }
                } elseif ($c === '/') {
                    $base_idx = $i + 1;
                    break;
                } elseif ($dot_idx) {
                    break;
                }
            }
        }
        if (empty($dot_idx)) {
            return '';
        }
        return $base_idx < $dot_idx ? substr($path, $dot_idx) : '';
    }

    /**
     * last lower case dot extension name
     * 'hello.JS.ERB' => '.erb'
     * @param string $path - only path, no ?query no #hash, 仅仅只有 path, 没有 ?query 没有 #hash
     * @param bool $is_locale - $path is locale path
     * @return string
     */
    // public static function lower_dot_ext($path, $is_locale = false)
    // {
    //     $ext = self::dot_ext($path, $is_locale);
    //     return empty($ext) ? '' : strtolower($ext);
    // }

    /**
     * full extension name
     * 'hello.JS.ERB' => '.JS.ERB'
     * '.' => ''
     * '..' => '.'
     * '.hello' => ''
     * 'hello.' => '.'
     * ----------
     * $full_ext = self::full_ext($path, $is_locale);
     * lower_full_ext = empty($full_ext) ? '' : strtolower($full_ext);
     * ----------
     * @param string $path - only path, no ?query no #hash, 仅仅只有 path, 没有 ?query 没有 #hash
     * @param bool $is_locale - $path is locale path
     * @return string - 原封不动地返回全部扩展名，包括点(.), 不转换大小写，例如 x.hTmL.PHP 返回 .hTmL.PHP
     */
    public static function full_ext($path, $is_locale = false)
    {
        $path = empty($path) ? '' : trim($path);
        if (empty($path)) {
            return '';
        }
        $len = strlen($path);
        if ($len < 2) { // strlen(p.) >= 2
            return '';
        }

        $dot_idx = false;
        $dot_idx2 = false;
        $base_idx = 0;
        if ($is_locale) {
            for ($i = $len - 1; $i > 0; $i--) {
                $c = $path[$i];
                if ($c === '.') {
                    $dot_idx2 = $dot_idx;
                    $dot_idx = $i;
                } elseif ($c === '/' || $c === DIRECTORY_SEPARATOR) {
                    $base_idx = $i + 1;
                    break;
                }
            }
        } else {
            for ($i = $len - 1; $i > 0; $i--) {
                $c = $path[$i];
                if ($c === '.') {
                    $dot_idx2 = $dot_idx;
                    $dot_idx = $i;
                } elseif ($c === '/') {
                    $base_idx = $i + 1;
                    break;
                }
            }
        }
        if (empty($dot_idx)) {
            return '';
        }

        if ($dot_idx > $base_idx) {
            return substr($path, $dot_idx);
        } elseif ($dot_idx2 && $dot_idx2 > $base_idx) {
            return substr($path, $dot_idx2);
        }
        return '';
    }

    /**
     * lower case full extension name
     * 'hello.JS.ERB' => '.js.erb'
     * @param string $path
     * @param bool $is_locale - $path is locale path
     * @return string
     */
    // public static function lower_full_ext($path, $is_locale = false)
    // {
    //     $ext = self::full_ext($path, $is_locale);
    //     return empty($ext) ? '' : strtolower($ext);
    // }

    // ----------

    /**
     * lower_ext_of_full = ext_of_full(lower_full_ext)
     * @param string $full_ext
     * @return string
     */
    public static function ext_of_full($full_ext)
    {
        $full_ext = empty($full_ext) ? '' : trim($full_ext);
        if (empty($full_ext)) {
            return '';
        }
        $len = strlen($full_ext);
        if ($len < 2) { // strlen(.e) >= 2
            return '';
        }

        $idx = strrpos($full_ext, '.');
        if ($idx === false) {
            return '';
        } else {
            return $idx + 1 < $len ? substr($full_ext, $idx + 1) : '';
        }
    }

    /**
     * lower_dot_ext_of_full = dot_ext_of_full(lower_full_ext)
     * @param string $full_ext
     * @return string
     */
    public static function dot_ext_of_full($full_ext)
    {
        $full_ext = empty($full_ext) ? '' : trim($full_ext);
        if (empty($full_ext)) {
            return '';
        }

        $idx = strrpos($full_ext, '.');
        if ($idx === false) {
            return '';
        } else {
            return $idx > 0 ? substr($full_ext, $idx) : $full_ext;
        }
    }

    // ----------

    /**
     * @param string $path - only path, no ?query no #hash, 仅仅只有 path, 没有 ?query 没有 #hash
     * @return bool
     */
    public static function is_html($path)
    {
        $path = empty($path) ? '' : trim($path);
        if (empty($path)) {
            return false;
        }
        return strlen($path) > 5 && strtolower(substr($path, -5)) === '.html';
    }

    // ----------

    public static function ext_type_map()
    {
        return [
            // application
            'atom' => 'application/atom+xml',
            'rss' => 'application/rss+xml',
            'jar' => 'application/java-archive',
            'war' => 'application/java-archive',
            'ear' => 'application/java-archive',
            'json' => 'application/json',
            'hqx' => 'application/mac-binhex40',
            'doc' => 'application/msword',
            'pdf' => 'application/pdf',
            'ps' => 'application/postscript',
            'eps' => 'application/postscript',
            'ai' => 'application/postscript',
            'rtf' => 'application/rtf',
            'm3u8' => 'application/vnd.apple.mpegurl',
            'kml' => 'application/vnd.google-earth.kml+xml',
            'kmz' => 'application/vnd.google-earth.kmz',
            'xls' => 'application/vnd.ms-excel',
            'eot' => 'application/vnd.ms-fontobject',
            'ppt' => 'application/vnd.ms-powerpoint',
            'odg' => 'application/vnd.oasis.opendocument.graphics',
            'odp' => 'application/vnd.oasis.opendocument.presentation',
            'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
            'odt' => 'application/vnd.oasis.opendocument.text',
            'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
            'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
            'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
            'wmlc' => 'application/vnd.wap.wmlc',
            'wasm' => 'application/wasm',
            '7z' => 'application/x-7z-compressed',
            'cco' => 'application/x-cocoa',
            'jardiff' => 'application/x-java-archive-diff',
            'jnlp' => 'application/x-java-jnlp-file',
            'run' => 'application/x-makeself',
            'pl' => 'application/x-perl',
            'pm' => 'application/x-perl',
            'prc' => 'application/x-pilot',
            // 'prc' => 'application/x-mobipocket-ebook',
            'pdb' => 'application/x-pilot',
            // 'pdb' => 'application/vnd.palm',
            'rar' => 'application/x-rar-compressed',
            // 'rar' => 'application/vnd.rar',
            'rpm' => 'application/x-redhat-package-manager',
            'sea' => 'application/x-sea',
            'swf' => 'application/x-shockwave-flash',
            'sit' => 'application/x-stuffit',
            'tcl' => 'application/x-tcl',
            'tk' => 'application/x-tcl',
            'der' => 'application/x-x509-ca-cert',
            'pem' => 'application/x-x509-ca-cert',
            'crt' => 'application/x-x509-ca-cert',
            'xpi' => 'application/x-xpinstall',
            'xhtml' => 'application/xhtml+xml',
            'xspf' => 'application/xspf+xml',
            'zip' => 'application/zip',
            'bin' => 'application/octet-stream',
            'exe' => 'application/octet-stream',
            // 'exe' => 'application/x-msdos-program',
            'dll' => 'application/octet-stream',
            // 'dll' => 'application/x-msdownload',
            'deb' => 'application/octet-stream',
            // 'deb' => 'application/x-debian-package',
            'dmg' => 'application/octet-stream',
            // 'dmg' => 'application/x-apple-diskimage',
            'iso' => 'application/octet-stream',
            // 'iso' => 'application/x-iso9660-image',
            'img' => 'application/octet-stream',
            'msi' => 'application/octet-stream',
            // 'msi' => 'application/x-msdownload',
            'msp' => 'application/octet-stream',
            'msm' => 'application/octet-stream',

            // 其它，用到时解开退隐条路的注释，不要全部解开了
            // '123' => 'application/vnd.lotus-1-2-3',
            // '1km' => 'application/vnd.1000minds.decision-model+xml',
            // 'aab' => 'application/x-authorware-bin',
            // 'aam' => 'application/x-authorware-map',
            // 'aas' => 'application/x-authorware-seg',
            // 'abw' => 'application/x-abiword',
            // 'ac' => 'application/pkix-attr-cert',
            // 'acc' => 'application/vnd.americandynamics.acc',
            // 'ace' => 'application/x-ace-compressed',
            // 'acu' => 'application/vnd.acucobol',
            // 'acutc' => 'application/vnd.acucorp',
            // 'aep' => 'application/vnd.audiograph',
            // 'afm' => 'application/x-font-type1',
            // 'afp' => 'application/vnd.ibm.modcap',
            // 'ahead' => 'application/vnd.ahead.space',
            // 'air' => 'application/vnd.adobe.air-application-installer-package+zip',
            // 'ait' => 'application/vnd.dvb.ait',
            // 'ami' => 'application/vnd.amiga.ami',
            // 'apk' => 'application/vnd.android.package-archive',
            // 'application' => 'application/x-ms-application',
            // 'apr' => 'application/vnd.lotus-approach',
            // 'arc' => 'application/x-freearc',
            // 'arj' => 'application/x-arj',
            // 'asc' => 'application/pgp-signature',
            // 'aso' => 'application/vnd.accpac.simply.aso',
            // 'atc' => 'application/vnd.acucorp',
            // 'atomcat' => 'application/atomcat+xml',
            // 'atomdeleted' => 'application/atomdeleted+xml',
            // 'atomsvc' => 'application/atomsvc+xml',
            // 'atx' => 'application/vnd.antix.game-component',
            // 'aw' => 'application/applixware',
            // 'azf' => 'application/vnd.airzip.filesecure.azf',
            // 'azs' => 'application/vnd.airzip.filesecure.azs',
            // 'azw' => 'application/vnd.amazon.ebook',
            // 'bat' => 'application/x-msdownload',
            // 'bcpio' => 'application/x-bcpio',
            // 'bdf' => 'application/x-font-bdf',
            // 'bdm' => 'application/vnd.syncml.dm+wbxml',
            // 'bdoc' => 'application/bdoc',
            // 'bed' => 'application/vnd.realvnc.bed',
            // 'bh2' => 'application/vnd.fujitsu.oasysprs',
            // 'blb' => 'application/x-blorb',
            // 'blorb' => 'application/x-blorb',
            // 'bmi' => 'application/vnd.bmi',
            // 'bmml' => 'application/vnd.balsamiq.bmml+xml',
            // 'book' => 'application/vnd.framemaker',
            // 'box' => 'application/vnd.previewsystems.box',
            // 'boz' => 'application/x-bzip2',
            // 'bpk' => 'application/octet-stream',
            // 'buffer' => 'application/octet-stream',
            // 'bz' => 'application/x-bzip',
            // 'bz2' => 'application/x-bzip2',
            // 'c11amc' => 'application/vnd.cluetrust.cartomobile-config',
            // 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg',
            // 'c4d' => 'application/vnd.clonk.c4group',
            // 'c4f' => 'application/vnd.clonk.c4group',
            // 'c4g' => 'application/vnd.clonk.c4group',
            // 'c4p' => 'application/vnd.clonk.c4group',
            // 'c4u' => 'application/vnd.clonk.c4group',
            // 'cab' => 'application/vnd.ms-cab-compressed',
            // 'cap' => 'application/vnd.tcpdump.pcap',
            // 'car' => 'application/vnd.curl.car',
            // 'cat' => 'application/vnd.ms-pki.seccat',
            // 'cb7' => 'application/x-cbr',
            // 'cba' => 'application/x-cbr',
            // 'cbr' => 'application/x-cbr',
            // 'cbt' => 'application/x-cbr',
            // 'cbz' => 'application/x-cbr',
            // 'cct' => 'application/x-director',
            // 'ccxml' => 'application/ccxml+xml',
            // 'cdbcmsg' => 'application/vnd.contact.cmsg',
            // 'cdf' => 'application/x-netcdf',
            // 'cdfx' => 'application/cdfx+xml',
            // 'cdkey' => 'application/vnd.mediastation.cdkey',
            // 'cdmia' => 'application/cdmi-capability',
            // 'cdmic' => 'application/cdmi-container',
            // 'cdmid' => 'application/cdmi-domain',
            // 'cdmio' => 'application/cdmi-object',
            // 'cdmiq' => 'application/cdmi-queue',
            // 'cdxml' => 'application/vnd.chemdraw+xml',
            // 'cdy' => 'application/vnd.cinderella',
            // 'cer' => 'application/pkix-cert',
            // 'cfs' => 'application/x-cfs-compressed',
            // 'chat' => 'application/x-chat',
            // 'chm' => 'application/vnd.ms-htmlhelp',
            // 'chrt' => 'application/vnd.kde.kchart',
            // 'cii' => 'application/vnd.anser-web-certificate-issue-initiation',
            // 'cil' => 'application/vnd.ms-artgalry',
            // 'cjs' => 'application/node',
            // 'cla' => 'application/vnd.claymore',
            // 'class' => 'application/java-vm',
            // 'clkk' => 'application/vnd.crick.clicker.keyboard',
            // 'clkp' => 'application/vnd.crick.clicker.palette',
            // 'clkt' => 'application/vnd.crick.clicker.template',
            // 'clkw' => 'application/vnd.crick.clicker.wordbank',
            // 'clkx' => 'application/vnd.crick.clicker',
            // 'clp' => 'application/x-msclip',
            // 'cmc' => 'application/vnd.cosmocaller',
            // 'cmp' => 'application/vnd.yellowriver-custom-menu',
            // 'cod' => 'application/vnd.rim.cod',
            // 'com' => 'application/x-msdownload',
            // 'cpio' => 'application/x-cpio',
            // 'cpt' => 'application/mac-compactpro',
            // 'crd' => 'application/x-mscardfile',
            // 'crl' => 'application/pkix-crl',
            // 'crx' => 'application/x-chrome-extension',
            // 'cryptonote' => 'application/vnd.rig.cryptonote',
            // 'csh' => 'application/x-csh',
            // 'csl' => 'application/vnd.citationstyles.style+xml',
            // 'csp' => 'application/vnd.commonspace',
            // 'cst' => 'application/x-director',
            // 'cu' => 'application/cu-seeme',
            // 'cww' => 'application/prs.cww',
            // 'cxt' => 'application/x-director',
            // 'daf' => 'application/vnd.mobius.daf',
            // 'dart' => 'application/vnd.dart',
            // 'dataless' => 'application/vnd.fdsn.seed',
            // 'davmount' => 'application/davmount+xml',
            // 'dbf' => 'application/vnd.dbf',
            // 'dbk' => 'application/docbook+xml',
            // 'dcr' => 'application/x-director',
            // 'dd2' => 'application/vnd.oma.dd2+xml',
            // 'ddd' => 'application/vnd.fujixerox.ddd',
            // 'ddf' => 'application/vnd.syncml.dmddf+xml',
            // 'deploy' => 'application/octet-stream',
            // 'dfac' => 'application/vnd.dreamfactory',
            // 'dgc' => 'application/x-dgc-compressed',
            // 'dir' => 'application/x-director',
            // 'dis' => 'application/vnd.mobius.dis',
            // 'dist' => 'application/octet-stream',
            // 'distz' => 'application/octet-stream',
            // 'dmp' => 'application/vnd.tcpdump.pcap',
            // 'dms' => 'application/octet-stream',
            // 'dna' => 'application/vnd.dna',
            // 'docm' => 'application/vnd.ms-word.document.macroenabled.12',
            // 'dot' => 'application/msword',
            // 'dotm' => 'application/vnd.ms-word.template.macroenabled.12',
            // 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
            // 'dp' => 'application/vnd.osgi.dp',
            // 'dpg' => 'application/vnd.dpgraph',
            // 'dssc' => 'application/dssc+der',
            // 'dtb' => 'application/x-dtbook+xml',
            // 'dtd' => 'application/xml-dtd',
            // 'dump' => 'application/octet-stream',
            // 'dvi' => 'application/x-dvi',
            // 'dwd' => 'application/atsc-dwd+xml',
            // 'dxp' => 'application/vnd.spotfire.dxp',
            // 'dxr' => 'application/x-director',
            // 'ecma' => 'application/ecmascript',
            // 'edm' => 'application/vnd.novadigm.edm',
            // 'edx' => 'application/vnd.novadigm.edx',
            // 'efif' => 'application/vnd.picsel',
            // 'ei6' => 'application/vnd.pg.osasli',
            // 'elc' => 'application/octet-stream',
            // 'emma' => 'application/emma+xml',
            // 'emotionml' => 'application/emotionml+xml',
            // 'emz' => 'application/x-msmetafile',
            // 'epub' => 'application/epub+zip',
            // 'es' => 'application/ecmascript',
            // 'es3' => 'application/vnd.eszigno3+xml',
            // 'esa' => 'application/vnd.osgi.subsystem',
            // 'esf' => 'application/vnd.epson.esf',
            // 'et3' => 'application/vnd.eszigno3+xml',
            // 'eva' => 'application/x-eva',
            // 'evy' => 'application/x-envoy',
            // 'exi' => 'application/exi',
            // 'ext' => 'application/vnd.novadigm.ext',
            // 'ez' => 'application/andrew-inset',
            // 'ez2' => 'application/vnd.ezpix-album',
            // 'ez3' => 'application/vnd.ezpix-package',
            // 'fcdt' => 'application/vnd.adobe.formscentral.fcdt',
            // 'fcs' => 'application/vnd.isac.fcs',
            // 'fdf' => 'application/vnd.fdf',
            // 'fdt' => 'application/fdt+xml',
            // 'fe_launch' => 'application/vnd.denovo.fcselayout-link',
            // 'fg5' => 'application/vnd.fujitsu.oasysgp',
            // 'fgd' => 'application/x-director',
            // 'fig' => 'application/x-xfig',
            // 'flo' => 'application/vnd.micrografx.flo',
            // 'flw' => 'application/vnd.kde.kivio',
            // 'fm' => 'application/vnd.framemaker',
            // 'fnc' => 'application/vnd.frogans.fnc',
            // 'fo' => 'application/vnd.software602.filler.form+xml',
            // 'frame' => 'application/vnd.framemaker',
            // 'fsc' => 'application/vnd.fsc.weblaunch',
            // 'ftc' => 'application/vnd.fluxtime.clip',
            // 'fti' => 'application/vnd.anser-web-funds-transfer-initiation',
            // 'fxp' => 'application/vnd.adobe.fxp',
            // 'fxpl' => 'application/vnd.adobe.fxp',
            // 'fzs' => 'application/vnd.fuzzysheet',
            // 'g2w' => 'application/vnd.geoplan',
            // 'g3w' => 'application/vnd.geospace',
            // 'gac' => 'application/vnd.groove-account',
            // 'gam' => 'application/x-tads',
            // 'gbr' => 'application/rpki-ghostbusters',
            // 'gca' => 'application/x-gca-compressed',
            // 'gdoc' => 'application/vnd.google-apps.document',
            // 'geo' => 'application/vnd.dynageo',
            // 'geojson' => 'application/geo+json',
            // 'gex' => 'application/vnd.geometry-explorer',
            // 'ggb' => 'application/vnd.geogebra.file',
            // 'ggt' => 'application/vnd.geogebra.tool',
            // 'ghf' => 'application/vnd.groove-help',
            // 'gim' => 'application/vnd.groove-identity-message',
            // 'gml' => 'application/gml+xml',
            // 'gmx' => 'application/vnd.gmx',
            // 'gnumeric' => 'application/x-gnumeric',
            // 'gph' => 'application/vnd.flographit',
            // 'gpx' => 'application/gpx+xml',
            // 'gqf' => 'application/vnd.grafeq',
            // 'gqs' => 'application/vnd.grafeq',
            // 'gram' => 'application/srgs',
            // 'gramps' => 'application/x-gramps-xml',
            // 'gre' => 'application/vnd.geometry-explorer',
            // 'grv' => 'application/vnd.groove-injector',
            // 'grxml' => 'application/srgs+xml',
            // 'gsf' => 'application/x-font-ghostscript',
            // 'gsheet' => 'application/vnd.google-apps.spreadsheet',
            // 'gslides' => 'application/vnd.google-apps.presentation',
            // 'gtar' => 'application/x-gtar',
            // 'gtm' => 'application/vnd.groove-tool-message',
            // 'gxf' => 'application/gxf',
            // 'gxt' => 'application/vnd.geonext',
            // 'gz' => 'application/gzip',
            // 'hal' => 'application/vnd.hal+xml',
            // 'hbci' => 'application/vnd.hbci',
            // 'hdd' => 'application/x-virtualbox-hdd',
            // 'hdf' => 'application/x-hdf',
            // 'held' => 'application/atsc-held+xml',
            // 'hjson' => 'application/hjson',
            // 'hlp' => 'application/winhlp',
            // 'hpgl' => 'application/vnd.hp-hpgl',
            // 'hpid' => 'application/vnd.hp-hpid',
            // 'hps' => 'application/vnd.hp-hps',
            // 'htke' => 'application/vnd.kenameaapp',
            // 'hvd' => 'application/vnd.yamaha.hv-dic',
            // 'hvp' => 'application/vnd.yamaha.hv-voice',
            // 'hvs' => 'application/vnd.yamaha.hv-script',
            // 'i2g' => 'application/vnd.intergeo',
            // 'icc' => 'application/vnd.iccprofile',
            // 'icm' => 'application/vnd.iccprofile',
            // 'ifm' => 'application/vnd.shana.informed.formdata',
            // 'igl' => 'application/vnd.igloader',
            // 'igm' => 'application/vnd.insors.igm',
            // 'igx' => 'application/vnd.micrografx.igx',
            // 'iif' => 'application/vnd.shana.informed.interchange',
            // 'imp' => 'application/vnd.accpac.simply.imp',
            // 'ims' => 'application/vnd.ms-ims',
            // 'ink' => 'application/inkml+xml',
            // 'inkml' => 'application/inkml+xml',
            // 'install' => 'application/x-install-instructions',
            // 'iota' => 'application/vnd.astraea-software.iota',
            // 'ipfix' => 'application/ipfix',
            // 'ipk' => 'application/vnd.shana.informed.package',
            // 'irm' => 'application/vnd.ibm.rights-management',
            // 'irp' => 'application/vnd.irepository.package+xml',
            // 'itp' => 'application/vnd.shana.informed.formtemplate',
            // 'its' => 'application/its+xml',
            // 'ivp' => 'application/vnd.immervision-ivp',
            // 'ivu' => 'application/vnd.immervision-ivu',
            // 'jam' => 'application/vnd.jam',
            // 'jisp' => 'application/vnd.jisp',
            // 'jlt' => 'application/vnd.hp-jlyt',
            // 'joda' => 'application/vnd.joost.joda-archive',
            // 'json5' => 'application/json5',
            // 'jsonld' => 'application/ld+json',
            // 'jsonml' => 'application/jsonml+json',
            // 'karbon' => 'application/vnd.kde.karbon',
            // 'kdbx' => 'application/x-keepass2',
            // 'key' => 'application/vnd.apple.keynote',
            // 'kfo' => 'application/vnd.kde.kformula',
            // 'kia' => 'application/vnd.kidspiration',
            // 'kne' => 'application/vnd.kinar',
            // 'knp' => 'application/vnd.kinar',
            // 'kon' => 'application/vnd.kde.kontour',
            // 'kpr' => 'application/vnd.kde.kpresenter',
            // 'kpt' => 'application/vnd.kde.kpresenter',
            // 'kpxx' => 'application/vnd.ds-keypoint',
            // 'ksp' => 'application/vnd.kde.kspread',
            // 'ktr' => 'application/vnd.kahootz',
            // 'ktz' => 'application/vnd.kahootz',
            // 'kwd' => 'application/vnd.kde.kword',
            // 'kwt' => 'application/vnd.kde.kword',
            // 'lasxml' => 'application/vnd.las.las+xml',
            // 'latex' => 'application/x-latex',
            // 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop',
            // 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml',
            // 'les' => 'application/vnd.hhe.lesson-player',
            // 'lgr' => 'application/lgr+xml',
            // 'lha' => 'application/x-lzh-compressed',
            // 'link66' => 'application/vnd.route66.link66+xml',
            // 'list3820' => 'application/vnd.ibm.modcap',
            // 'listafp' => 'application/vnd.ibm.modcap',
            // 'lnk' => 'application/x-ms-shortcut',
            // 'lostxml' => 'application/lost+xml',
            // 'lrf' => 'application/octet-stream',
            // 'lrm' => 'application/vnd.ms-lrm',
            // 'ltf' => 'application/vnd.frogans.ltf',
            // 'luac' => 'application/x-lua-bytecode',
            // 'lwp' => 'application/vnd.lotus-wordpro',
            // 'lzh' => 'application/x-lzh-compressed',
            // 'm13' => 'application/x-msmediaview',
            // 'm14' => 'application/x-msmediaview',
            // 'm21' => 'application/mp21',
            // 'm4p' => 'application/mp4',
            // 'ma' => 'application/mathematica',
            // 'mads' => 'application/mads+xml',
            // 'maei' => 'application/mmt-aei+xml',
            // 'mag' => 'application/vnd.ecowin.chart',
            // 'maker' => 'application/vnd.framemaker',
            // 'map' => 'application/json',
            // 'mar' => 'application/octet-stream',
            // 'mathml' => 'application/mathml+xml',
            // 'mb' => 'application/mathematica',
            // 'mbk' => 'application/vnd.mobius.mbk',
            // 'mbox' => 'application/mbox',
            // 'mc1' => 'application/vnd.medcalcdata',
            // 'mcd' => 'application/vnd.mcd',
            // 'mdb' => 'application/x-msaccess',
            // 'meta4' => 'application/metalink4+xml',
            // 'metalink' => 'application/metalink+xml',
            // 'mets' => 'application/mets+xml',
            // 'mfm' => 'application/vnd.mfmp',
            // 'mft' => 'application/rpki-manifest',
            // 'mgp' => 'application/vnd.osgeo.mapguide.package',
            // 'mgz' => 'application/vnd.proteus.magazine',
            // 'mie' => 'application/x-mie',
            // 'mif' => 'application/vnd.mif',
            // 'mlp' => 'application/vnd.dolby.mlp',
            // 'mmd' => 'application/vnd.chipnuts.karaoke-mmd',
            // 'mmf' => 'application/vnd.smaf',
            // 'mny' => 'application/x-msmoney',
            // 'mobi' => 'application/x-mobipocket-ebook',
            // 'mods' => 'application/mods+xml',
            // 'mp21' => 'application/mp21',
            // 'mp4s' => 'application/mp4',
            // 'mpc' => 'application/vnd.mophun.certificate',
            // 'mpd' => 'application/dash+xml',
            // 'mpkg' => 'application/vnd.apple.installer+xml',
            // 'mpm' => 'application/vnd.blueice.multipass',
            // 'mpn' => 'application/vnd.mophun.application',
            // 'mpp' => 'application/vnd.ms-project',
            // 'mpt' => 'application/vnd.ms-project',
            // 'mpy' => 'application/vnd.ibm.minipay',
            // 'mqy' => 'application/vnd.mobius.mqy',
            // 'mrc' => 'application/marc',
            // 'mrcx' => 'application/marcxml+xml',
            // 'mscml' => 'application/mediaservercontrol+xml',
            // 'mseed' => 'application/vnd.fdsn.mseed',
            // 'mseq' => 'application/vnd.mseq',
            // 'msf' => 'application/vnd.epson.msf',
            // 'msg' => 'application/vnd.ms-outlook',
            // 'msl' => 'application/vnd.mobius.msl',
            // 'msty' => 'application/vnd.muvee.style',
            // 'mus' => 'application/vnd.musician',
            // 'musd' => 'application/mmt-usd+xml',
            // 'musicxml' => 'application/vnd.recordare.musicxml+xml',
            // 'mvb' => 'application/x-msmediaview',
            // 'mwf' => 'application/vnd.mfer',
            // 'mxf' => 'application/mxf',
            // 'mxl' => 'application/vnd.recordare.musicxml',
            // 'mxml' => 'application/xv+xml',
            // 'mxs' => 'application/vnd.triscape.mxs',
            // 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install',
            // 'nb' => 'application/mathematica',
            // 'nbp' => 'application/vnd.wolfram.player',
            // 'nc' => 'application/x-netcdf',
            // 'ncx' => 'application/x-dtbncx+xml',
            // 'ngdat' => 'application/vnd.nokia.n-gage.data',
            // 'nitf' => 'application/vnd.nitf',
            // 'nlu' => 'application/vnd.neurolanguage.nlu',
            // 'nml' => 'application/vnd.enliven',
            // 'nnd' => 'application/vnd.noblenet-directory',
            // 'nns' => 'application/vnd.noblenet-sealer',
            // 'nnw' => 'application/vnd.noblenet-web',
            // 'nq' => 'application/n-quads',
            // 'nsc' => 'application/x-conference',
            // 'nsf' => 'application/vnd.lotus-notes',
            // 'nt' => 'application/n-triples',
            // 'ntf' => 'application/vnd.nitf',
            // 'numbers' => 'application/vnd.apple.numbers',
            // 'nzb' => 'application/x-nzb',
            // 'oa2' => 'application/vnd.fujitsu.oasys2',
            // 'oa3' => 'application/vnd.fujitsu.oasys3',
            // 'oas' => 'application/vnd.fujitsu.oasys',
            // 'obd' => 'application/x-msbinder',
            // 'obgx' => 'application/vnd.openblox.game+xml',
            // 'oda' => 'application/oda',
            // 'odb' => 'application/vnd.oasis.opendocument.database',
            // 'odc' => 'application/vnd.oasis.opendocument.chart',
            // 'odf' => 'application/vnd.oasis.opendocument.formula',
            // 'odft' => 'application/vnd.oasis.opendocument.formula-template',
            // 'odi' => 'application/vnd.oasis.opendocument.image',
            // 'odm' => 'application/vnd.oasis.opendocument.text-master',
            // 'ogx' => 'application/ogg',
            // 'omdoc' => 'application/omdoc+xml',
            // 'onepkg' => 'application/onenote',
            // 'onetmp' => 'application/onenote',
            // 'onetoc' => 'application/onenote',
            // 'onetoc2' => 'application/onenote',
            // 'opf' => 'application/oebps-package+xml',
            // 'oprc' => 'application/vnd.palm',
            // 'org' => 'application/vnd.lotus-organizer',
            // 'osf' => 'application/vnd.yamaha.openscoreformat',
            // 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml',
            // 'osm' => 'application/vnd.openstreetmap.data+xml',
            // 'otc' => 'application/vnd.oasis.opendocument.chart-template',
            // 'otg' => 'application/vnd.oasis.opendocument.graphics-template',
            // 'oth' => 'application/vnd.oasis.opendocument.text-web',
            // 'oti' => 'application/vnd.oasis.opendocument.image-template',
            // 'otp' => 'application/vnd.oasis.opendocument.presentation-template',
            // 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
            // 'ott' => 'application/vnd.oasis.opendocument.text-template',
            // 'ova' => 'application/x-virtualbox-ova',
            // 'ovf' => 'application/x-virtualbox-ovf',
            // 'owl' => 'application/rdf+xml',
            // 'oxps' => 'application/oxps',
            // 'oxt' => 'application/vnd.openofficeorg.extension',
            // 'p10' => 'application/pkcs10',
            // 'p12' => 'application/x-pkcs12',
            // 'p7b' => 'application/x-pkcs7-certificates',
            // 'p7c' => 'application/pkcs7-mime',
            // 'p7m' => 'application/pkcs7-mime',
            // 'p7r' => 'application/x-pkcs7-certreqresp',
            // 'p7s' => 'application/pkcs7-signature',
            // 'p8' => 'application/pkcs8',
            // 'pac' => 'application/x-ns-proxy-autoconfig',
            // 'pages' => 'application/vnd.apple.pages',
            // 'paw' => 'application/vnd.pawaafile',
            // 'pbd' => 'application/vnd.powerbuilder6',
            // 'pcap' => 'application/vnd.tcpdump.pcap',
            // 'pcf' => 'application/x-font-pcf',
            // 'pcl' => 'application/vnd.hp-pcl',
            // 'pclxl' => 'application/vnd.hp-pclxl',
            // 'pcurl' => 'application/vnd.curl.pcurl',
            // 'pfa' => 'application/x-font-type1',
            // 'pfb' => 'application/x-font-type1',
            // 'pfm' => 'application/x-font-type1',
            // 'pfr' => 'application/font-tdpfr',
            // 'pfx' => 'application/x-pkcs12',
            // 'pgn' => 'application/x-chess-pgn',
            // 'pgp' => 'application/pgp-encrypted',
            // 'php' => 'application/x-httpd-php',
            // 'pkg' => 'application/octet-stream',
            // 'pki' => 'application/pkixcmp',
            // 'pkipath' => 'application/pkix-pkipath',
            // 'pkpass' => 'application/vnd.apple.pkpass',
            // 'plb' => 'application/vnd.3gpp.pic-bw-large',
            // 'plc' => 'application/vnd.mobius.plc',
            // 'plf' => 'application/vnd.pocketlearn',
            // 'pls' => 'application/pls+xml',
            // 'pml' => 'application/vnd.ctc-posml',
            // 'portpkg' => 'application/vnd.macports.portpkg',
            // 'pot' => 'application/vnd.ms-powerpoint',
            // 'potm' => 'application/vnd.ms-powerpoint.template.macroenabled.12',
            // 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
            // 'ppam' => 'application/vnd.ms-powerpoint.addin.macroenabled.12',
            // 'ppd' => 'application/vnd.cups-ppd',
            // 'pps' => 'application/vnd.ms-powerpoint',
            // 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroenabled.12',
            // 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
            // 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroenabled.12',
            // 'pqa' => 'application/vnd.palm',
            // 'pre' => 'application/vnd.lotus-freelance',
            // 'prf' => 'application/pics-rules',
            // 'provx' => 'application/provenance+xml',
            // 'psb' => 'application/vnd.3gpp.pic-bw-small',
            // 'psf' => 'application/x-font-linux-psf',
            // 'pskcxml' => 'application/pskc+xml',
            // 'ptid' => 'application/vnd.pvi.ptid1',
            // 'pub' => 'application/x-mspublisher',
            // 'pvb' => 'application/vnd.3gpp.pic-bw-var',
            // 'pwn' => 'application/vnd.3m.post-it-notes',
            // 'qam' => 'application/vnd.epson.quickanime',
            // 'qbo' => 'application/vnd.intu.qbo',
            // 'qfx' => 'application/vnd.intu.qfx',
            // 'qps' => 'application/vnd.publishare-delta-tree',
            // 'qwd' => 'application/vnd.quark.quarkxpress',
            // 'qwt' => 'application/vnd.quark.quarkxpress',
            // 'qxb' => 'application/vnd.quark.quarkxpress',
            // 'qxd' => 'application/vnd.quark.quarkxpress',
            // 'qxl' => 'application/vnd.quark.quarkxpress',
            // 'qxt' => 'application/vnd.quark.quarkxpress',
            // 'raml' => 'application/raml+yaml',
            // 'rapd' => 'application/route-apd+xml',
            // 'rcprofile' => 'application/vnd.ipunplugged.rcprofile',
            // 'rdf' => 'application/rdf+xml',
            // 'rdz' => 'application/vnd.data-vision.rdz',
            // 'relo' => 'application/p2p-overlay+xml',
            // 'rep' => 'application/vnd.businessobjects',
            // 'res' => 'application/x-dtbresource+xml',
            // 'rif' => 'application/reginfo+xml',
            // 'ris' => 'application/x-research-info-systems',
            // 'rl' => 'application/resource-lists+xml',
            // 'rld' => 'application/resource-lists-diff+xml',
            // 'rm' => 'application/vnd.rn-realmedia',
            // 'rms' => 'application/vnd.jcp.javame.midlet-rms',
            // 'rmvb' => 'application/vnd.rn-realmedia-vbr',
            // 'rnc' => 'application/relax-ng-compact-syntax',
            // 'rng' => 'application/xml',
            // 'roa' => 'application/rpki-roa',
            // 'rp9' => 'application/vnd.cloanto.rp9',
            // 'rpss' => 'application/vnd.nokia.radio-presets',
            // 'rpst' => 'application/vnd.nokia.radio-preset',
            // 'rq' => 'application/sparql-query',
            // 'rs' => 'application/rls-services+xml',
            // 'rsat' => 'application/atsc-rsat+xml',
            // 'rsd' => 'application/rsd+xml',
            // 'rsheet' => 'application/urc-ressheet+xml',
            // 'rusd' => 'application/route-usd+xml',
            // 'saf' => 'application/vnd.yamaha.smaf-audio',
            // 'sbml' => 'application/sbml+xml',
            // 'sc' => 'application/vnd.ibm.secure-container',
            // 'scd' => 'application/x-msschedule',
            // 'scm' => 'application/vnd.lotus-screencam',
            // 'scq' => 'application/scvp-cv-request',
            // 'scs' => 'application/scvp-cv-response',
            // 'sda' => 'application/vnd.stardivision.draw',
            // 'sdc' => 'application/vnd.stardivision.calc',
            // 'sdd' => 'application/vnd.stardivision.impress',
            // 'sdkd' => 'application/vnd.solent.sdkm+xml',
            // 'sdkm' => 'application/vnd.solent.sdkm+xml',
            // 'sdp' => 'application/sdp',
            // 'sdw' => 'application/vnd.stardivision.writer',
            // 'see' => 'application/vnd.seemail',
            // 'seed' => 'application/vnd.fdsn.seed',
            // 'sema' => 'application/vnd.sema',
            // 'semd' => 'application/vnd.semd',
            // 'semf' => 'application/vnd.semf',
            // 'senmlx' => 'application/senml+xml',
            // 'sensmlx' => 'application/sensml+xml',
            // 'ser' => 'application/java-serialized-object',
            // 'setpay' => 'application/set-payment-initiation',
            // 'setreg' => 'application/set-registration-initiation',
            // 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data',
            // 'sfs' => 'application/vnd.spotfire.sfs',
            // 'sgl' => 'application/vnd.stardivision.writer-global',
            // 'sh' => 'application/x-sh',
            // 'shar' => 'application/x-shar',
            // 'shf' => 'application/shf+xml',
            // 'sieve' => 'application/sieve',
            // 'sig' => 'application/pgp-signature',
            // 'sis' => 'application/vnd.symbian.install',
            // 'sisx' => 'application/vnd.symbian.install',
            // 'sitx' => 'application/x-stuffitx',
            // 'siv' => 'application/sieve',
            // 'skd' => 'application/vnd.koan',
            // 'skm' => 'application/vnd.koan',
            // 'skp' => 'application/vnd.koan',
            // 'skt' => 'application/vnd.koan',
            // 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12',
            // 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
            // 'sls' => 'application/route-s-tsid+xml',
            // 'slt' => 'application/vnd.epson.salt',
            // 'sm' => 'application/vnd.stepmania.stepchart',
            // 'smf' => 'application/vnd.stardivision.math',
            // 'smi' => 'application/smil+xml',
            // 'smil' => 'application/smil+xml',
            // 'smzip' => 'application/vnd.stepmania.package',
            // 'snf' => 'application/x-font-snf',
            // 'so' => 'application/octet-stream',
            // 'spc' => 'application/x-pkcs7-certificates',
            // 'spf' => 'application/vnd.yamaha.smaf-phrase',
            // 'spl' => 'application/x-futuresplash',
            // 'spp' => 'application/scvp-vp-response',
            // 'spq' => 'application/scvp-vp-request',
            // 'sql' => 'application/x-sql',
            // 'src' => 'application/x-wais-source',
            // 'srt' => 'application/x-subrip',
            // 'sru' => 'application/sru+xml',
            // 'srx' => 'application/sparql-results+xml',
            // 'ssdl' => 'application/ssdl+xml',
            // 'sse' => 'application/vnd.kodak-descriptor',
            // 'ssf' => 'application/vnd.epson.ssf',
            // 'ssml' => 'application/ssml+xml',
            // 'st' => 'application/vnd.sailingtracker.track',
            // 'stc' => 'application/vnd.sun.xml.calc.template',
            // 'std' => 'application/vnd.sun.xml.draw.template',
            // 'stf' => 'application/vnd.wt.stf',
            // 'sti' => 'application/vnd.sun.xml.impress.template',
            // 'stk' => 'application/hyperstudio',
            // 'str' => 'application/vnd.pg.format',
            // 'stw' => 'application/vnd.sun.xml.writer.template',
            // 'sus' => 'application/vnd.sus-calendar',
            // 'susp' => 'application/vnd.sus-calendar',
            // 'sv4cpio' => 'application/x-sv4cpio',
            // 'sv4crc' => 'application/x-sv4crc',
            // 'svc' => 'application/vnd.dvb.service',
            // 'svd' => 'application/vnd.svd',
            // 'swa' => 'application/x-director',
            // 'swi' => 'application/vnd.aristanetworks.swi',
            // 'swidtag' => 'application/swid+xml',
            // 'sxc' => 'application/vnd.sun.xml.calc',
            // 'sxd' => 'application/vnd.sun.xml.draw',
            // 'sxg' => 'application/vnd.sun.xml.writer.global',
            // 'sxi' => 'application/vnd.sun.xml.impress',
            // 'sxm' => 'application/vnd.sun.xml.math',
            // 'sxw' => 'application/vnd.sun.xml.writer',
            // 't3' => 'application/x-t3vm-image',
            // 'taglet' => 'application/vnd.mynfc',
            // 'tao' => 'application/vnd.tao.intent-module-archive',
            // 'tar' => 'application/x-tar',
            // 'tcap' => 'application/vnd.3gpp2.tcap',
            // 'td' => 'application/urc-targetdesc+xml',
            // 'teacher' => 'application/vnd.smart.teacher',
            // 'tei' => 'application/tei+xml',
            // 'teicorpus' => 'application/tei+xml',
            // 'tex' => 'application/x-tex',
            // 'texi' => 'application/x-texinfo',
            // 'texinfo' => 'application/x-texinfo',
            // 'tfi' => 'application/thraud+xml',
            // 'tfm' => 'application/x-tex-tfm',
            // 'thmx' => 'application/vnd.ms-officetheme',
            // 'tmo' => 'application/vnd.tmobile-livetv',
            // 'toml' => 'application/toml',
            // 'torrent' => 'application/x-bittorrent',
            // 'tpl' => 'application/vnd.groove-tool-template',
            // 'tpt' => 'application/vnd.trid.tpt',
            // 'tra' => 'application/vnd.trueapp',
            // 'trm' => 'application/x-msterminal',
            // 'tsd' => 'application/timestamped-data',
            // 'ttml' => 'application/ttml+xml',
            // 'twd' => 'application/vnd.simtech-mindmapper',
            // 'twds' => 'application/vnd.simtech-mindmapper',
            // 'txd' => 'application/vnd.genomatix.tuxedo',
            // 'txf' => 'application/vnd.mobius.txf',
            // 'u32' => 'application/x-authorware-bin',
            // 'ubj' => 'application/ubjson',
            // 'udeb' => 'application/x-debian-package',
            // 'ufd' => 'application/vnd.ufdl',
            // 'ufdl' => 'application/vnd.ufdl',
            // 'ulx' => 'application/x-glulx',
            // 'umj' => 'application/vnd.umajin',
            // 'unityweb' => 'application/vnd.unity',
            // 'uoml' => 'application/vnd.uoml+xml',
            // 'uvt' => 'application/vnd.dece.ttml+xml',
            // 'uvvd' => 'application/vnd.dece.data',
            // 'uvvf' => 'application/vnd.dece.data',
            // 'ustar' => 'application/x-ustar',
            // 'utz' => 'application/vnd.uiq.theme',
            // 'uvd' => 'application/vnd.dece.data',
            // 'uvf' => 'application/vnd.dece.data',
            // 'uvvt' => 'application/vnd.dece.ttml+xml',
            // 'uvvx' => 'application/vnd.dece.unspecified',
            // 'uvvz' => 'application/vnd.dece.zip',
            // 'uvx' => 'application/vnd.dece.unspecified',
            // 'uvz' => 'application/vnd.dece.zip',
            // 'vbox' => 'application/x-virtualbox-vbox',
            // 'vbox-extpack' => 'application/x-virtualbox-vbox-extpack',
            // 'vcd' => 'application/x-cdlink',
            // 'vcg' => 'application/vnd.groove-vcard',
            // 'vcx' => 'application/vnd.vcx',
            // 'vdi' => 'application/x-virtualbox-vdi',
            // 'vhd' => 'application/x-virtualbox-vhd',
            // 'vis' => 'application/vnd.visionary',
            // 'vmdk' => 'application/x-virtualbox-vmdk',
            // 'vor' => 'application/vnd.stardivision.writer',
            // 'vox' => 'application/x-authorware-bin',
            // 'vsd' => 'application/vnd.visio',
            // 'vsf' => 'application/vnd.vsf',
            // 'vss' => 'application/vnd.visio',
            // 'vst' => 'application/vnd.visio',
            // 'vsw' => 'application/vnd.visio',
            // 'vxml' => 'application/voicexml+xml',
            // 'w3d' => 'application/x-director',
            // 'wad' => 'application/x-doom',
            // 'wadl' => 'application/vnd.sun.wadl+xml',
            // 'wbs' => 'application/vnd.criticaltools.wbs+xml',
            // 'wbxml' => 'application/vnd.wap.wbxml',
            // 'wcm' => 'application/vnd.ms-works',
            // 'wdb' => 'application/vnd.ms-works',
            // 'webapp' => 'application/x-web-app-manifest+json',
            // 'webmanifest' => 'application/manifest+json',
            // 'wg' => 'application/vnd.pmi.widget',
            // 'wgt' => 'application/widget',
            // 'wks' => 'application/vnd.ms-works',
            // 'wmd' => 'application/x-ms-wmd',
            // 'wmlsc' => 'application/vnd.wap.wmlscriptc',
            // 'wmz' => 'application/x-ms-wmz',
            // 'wpd' => 'application/vnd.wordperfect',
            // 'wpl' => 'application/vnd.ms-wpl',
            // 'wps' => 'application/vnd.ms-works',
            // 'wqd' => 'application/vnd.wqd',
            // 'wri' => 'application/x-mswrite',
            // 'wsdl' => 'application/wsdl+xml',
            // 'wspolicy' => 'application/wspolicy+xml',
            // 'wtb' => 'application/vnd.webturbo',
            // 'x32' => 'application/x-authorware-bin',
            // 'xaml' => 'application/xaml+xml',
            // 'xap' => 'application/x-silverlight-app',
            // 'xar' => 'application/vnd.xara',
            // 'xav' => 'application/xcap-att+xml',
            // 'xbap' => 'application/x-ms-xbap',
            // 'xbd' => 'application/vnd.fujixerox.docuworks.binder',
            // 'xca' => 'application/xcap-caps+xml',
            // 'xcs' => 'application/calendar+xml',
            // 'xdf' => 'application/mrb-consumer+xml',
            // 'xdm' => 'application/vnd.syncml.dm+xml',
            // 'xdp' => 'application/vnd.adobe.xdp+xml',
            // 'xdssc' => 'application/dssc+xml',
            // 'xdw' => 'application/vnd.fujixerox.docuworks',
            // 'xel' => 'application/xcap-el+xml',
            // 'xenc' => 'application/xenc+xml',
            // 'xer' => 'application/patch-ops-error+xml',
            // 'xfdf' => 'application/vnd.adobe.xfdf',
            // 'xfdl' => 'application/vnd.xfdl',
            // 'xht' => 'application/xhtml+xml',
            // 'xhvml' => 'application/xv+xml',
            // 'xla' => 'application/vnd.ms-excel',
            // 'xlam' => 'application/vnd.ms-excel.addin.macroenabled.12',
            // 'xlc' => 'application/vnd.ms-excel',
            // 'xlf' => 'application/xliff+xml',
            // 'xlm' => 'application/vnd.ms-excel',
            // 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroenabled.12',
            // 'xlsm' => 'application/vnd.ms-excel.sheet.macroenabled.12',
            // 'xlt' => 'application/vnd.ms-excel',
            // 'xltm' => 'application/vnd.ms-excel.template.macroenabled.12',
            // 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
            // 'xlw' => 'application/vnd.ms-excel',
            // 'xml' => 'application/xml',
            // 'xns' => 'application/xcap-ns+xml',
            // 'xo' => 'application/vnd.olpc-sugar',
            // 'xop' => 'application/xop+xml',
            // 'xpl' => 'application/xproc+xml',
            // 'xpr' => 'application/vnd.is-xpr',
            // 'xps' => 'application/vnd.ms-xpsdocument',
            // 'xpw' => 'application/vnd.intercon.formnet',
            // 'xpx' => 'application/vnd.intercon.formnet',
            // 'xsd' => 'application/xml',
            // 'xsl' => 'application/xml',
            // 'xslt' => 'application/xslt+xml',
            // 'xsm' => 'application/vnd.syncml+xml',
            // 'xul' => 'application/vnd.mozilla.xul+xml',
            // 'xvm' => 'application/xv+xml',
            // 'xvml' => 'application/xv+xml',
            // 'xz' => 'application/x-xz',
            // 'yang' => 'application/yang',
            // 'yin' => 'application/yin+xml',
            // 'z1' => 'application/x-zmachine',
            // 'z2' => 'application/x-zmachine',
            // 'z3' => 'application/x-zmachine',
            // 'z4' => 'application/x-zmachine',
            // 'z5' => 'application/x-zmachine',
            // 'z6' => 'application/x-zmachine',
            // 'z7' => 'application/x-zmachine',
            // 'z8' => 'application/x-zmachine',
            // 'zaz' => 'application/vnd.zzazz.deck+xml',
            // 'zir' => 'application/vnd.zul',
            // 'zirz' => 'application/vnd.zul',
            // 'zmm' => 'application/vnd.handheld-entertainment+xml',

            // audio
            'mid' => 'audio/midi',
            'midi' => 'audio/midi',
            'kar' => 'audio/midi',
            'mp3' => 'audio/mpeg',
            'ogg' => 'audio/ogg',
            'm4a' => 'audio/x-m4a',
            // 'm4a' => 'audio/mp4',
            'ra' => 'audio/x-realaudio',
            // 'ra' => 'audio/x-pn-realaudio',

            // 其它，用到时解开退隐条路的注释，不要全部解开了
            // 'mp2' => 'audio/mpeg',
            // 'mp2a' => 'audio/mpeg',
            // 'mp4a' => 'audio/mp4',
            // 'mpga' => 'audio/mpeg',
            // 'mxmf' => 'audio/mobile-xmf',
            // 'oga' => 'audio/ogg',
            // 'pya' => 'audio/vnd.ms-playready.media.pya',
            // 'ram' => 'audio/x-pn-realaudio',
            // 'rip' => 'audio/vnd.rip',
            // 'rmi' => 'audio/midi',
            // 'rmp' => 'audio/x-pn-realaudio-plugin',
            // 's3m' => 'audio/s3m',
            // 'sil' => 'audio/silk',
            // 'snd' => 'audio/basic',
            // 'spx' => 'audio/ogg',
            // 'xm' => 'audio/xm',
            // 'aac' => 'audio/x-aac',
            // 'adp' => 'audio/adpcm',
            // 'aif' => 'audio/x-aiff',
            // 'aifc' => 'audio/x-aiff',
            // 'aiff' => 'audio/x-aiff',
            // 'au' => 'audio/basic',
            // 'caf' => 'audio/x-caf',
            // 'wma' => 'audio/x-ms-wma',
            // 'dra' => 'audio/vnd.dra',
            // 'dts' => 'audio/vnd.dts',
            // 'dtshd' => 'audio/vnd.dts.hd',
            // 'ecelp4800' => 'audio/vnd.nuera.ecelp4800',
            // 'ecelp7470' => 'audio/vnd.nuera.ecelp7470',
            // 'ecelp9600' => 'audio/vnd.nuera.ecelp9600',
            // 'eol' => 'audio/vnd.digital-winds',
            // 'wav' => 'audio/wave',
            // 'wax' => 'audio/x-ms-wax',
            // 'weba' => 'audio/webm',
            // 'uva' => 'audio/vnd.dece.audio',
            // 'uvva' => 'audio/vnd.dece.audio',
            // 'flac' => 'audio/x-flac',
            // 'lvp' => 'audio/vnd.lucent.voice',
            // 'm2a' => 'audio/mpeg',
            // 'm3a' => 'audio/mpeg',
            // 'm3u' => 'audio/x-mpegurl',
            // 'mka' => 'audio/x-matroska',

            // font
            'woff' => 'font/woff',
            'woff2' => 'font/woff2',
            // 其它，用到时解开退隐条路的注释，不要全部解开了
            // 'otf' => 'font/otf',
            // 'ttc' => 'font/collection',
            // 'ttf' => 'font/ttf',

            // haptics

            // image
            'gif' => 'image/gif',
            'jpeg' => 'image/jpeg',
            'jpg' => 'image/jpeg',
            'avif' => 'image/avif',
            'png' => 'image/png',
            'svg' => 'image/svg+xml',
            'svgz' => 'image/svg+xml',
            'tif' => 'image/tiff',
            'tiff' => 'image/tiff',
            'wbmp' => 'image/vnd.wap.wbmp',
            'webp' => 'image/webp',
            'ico' => 'image/x-icon',
            // 'ico' => 'image/vnd.microsoft.icon',
            'jng' => 'image/x-jng',
            // 'bmp' => 'image/x-ms-bmp',
            'bmp' => 'image/bmp',

            // 其它，用到时解开退隐条路的注释，不要全部解开了
            // 'npx' => 'image/vnd.net-fpx',
            // 'pbm' => 'image/x-portable-bitmap',
            // 'pct' => 'image/x-pict',
            // 'pcx' => 'image/vnd.zbrush.pcx',
            // 'pgm' => 'image/x-portable-graymap',
            // 'pic' => 'image/x-pict',
            // 'pnm' => 'image/x-portable-anymap',
            // 'ppm' => 'image/x-portable-pixmap',
            // 'psd' => 'image/vnd.adobe.photoshop',
            // 'pti' => 'image/prs.pti',
            // 'ras' => 'image/x-cmu-raster',
            // 'rgb' => 'image/x-rgb',
            // 'rlc' => 'image/vnd.fujixerox.edmics-rlc',
            // 'sgi' => 'image/sgi',
            // 'sid' => 'image/x-mrsid-image',
            // 'tfx' => 'image/tiff-fx',
            // 'tga' => 'image/x-tga',
            // 'xwd' => 'image/x-xwindowdump',
            // 'xpm' => 'image/x-xpixmap',
            // 'xif' => 'image/vnd.xiff',
            // '3ds' => 'image/x-3ds',
            // 'apng' => 'image/apng',
            // 'azv' => 'image/vnd.airzip.accelerator.azv',
            // 'b16' => 'image/vnd.pco.b16',
            // 'btif' => 'image/prs.btif',
            // 'cmx' => 'image/x-cmx',
            // 'xbm' => 'image/x-xbitmap',
            // 'wmf' => 'image/wmf',
            // 'cgm' => 'image/cgm',
            // 'dds' => 'image/vnd.ms-dds',
            // 'djv' => 'image/vnd.djvu',
            // 'djvu' => 'image/vnd.djvu',
            // 'drle' => 'image/dicom-rle',
            // 'dwg' => 'image/vnd.dwg',
            // 'dxf' => 'image/vnd.dxf',
            // 'emf' => 'image/emf',
            // 'exr' => 'image/aces',
            // 't38' => 'image/t38',
            // 'tap' => 'image/vnd.tencent.tap',
            // 'vtf' => 'image/vnd.valve.source.texture',
            // 'wdp' => 'image/vnd.ms-photo',
            // 'uvg' => 'image/vnd.dece.graphic',
            // 'uvi' => 'image/vnd.dece.graphic',
            // 'uvvg' => 'image/vnd.dece.graphic',
            // 'uvvi' => 'image/vnd.dece.graphic',
            // 'fbs' => 'image/vnd.fastbidsheet',
            // 'fh' => 'image/x-freehand',
            // 'fh4' => 'image/x-freehand',
            // 'fh5' => 'image/x-freehand',
            // 'fh7' => 'image/x-freehand',
            // 'fhc' => 'image/x-freehand',
            // 'fits' => 'image/fits',
            // 'fpx' => 'image/vnd.fpx',
            // 'fst' => 'image/vnd.fst',
            // 'g3' => 'image/g3fax',
            // 'heic' => 'image/heic',
            // 'heics' => 'image/heic-sequence',
            // 'heif' => 'image/heif',
            // 'heifs' => 'image/heif-sequence',
            // 'hej2' => 'image/hej2k',
            // 'hsj2' => 'image/hsj2',
            // 'ief' => 'image/ief',
            // 'jhc' => 'image/jphc',
            // 'jls' => 'image/jls',
            // 'jp2' => 'image/jp2',
            // 'jpe' => 'image/jpeg',
            // 'jpf' => 'image/jpx',
            // 'jpg2' => 'image/jp2',
            // 'jph' => 'image/jph',
            // 'jpm' => 'image/jpm',
            // 'jpx' => 'image/jpx',
            // 'jxr' => 'image/jxr',
            // 'jxra' => 'image/jxra',
            // 'jxrs' => 'image/jxrs',
            // 'jxs' => 'image/jxs',
            // 'jxsc' => 'image/jxsc',
            // 'jxsi' => 'image/jxsi',
            // 'jxss' => 'image/jxss',
            // 'ktx' => 'image/ktx',
            // 'ktx2' => 'image/ktx2',
            // 'mdi' => 'image/vnd.ms-modi',
            // 'mmr' => 'image/vnd.fujixerox.edmics-mmr',

            // model
            // 其它，用到时解开退隐条路的注释，不要全部解开了
            // 'msh' => 'model/mesh',
            // 'mtl' => 'model/mtl',
            // 'mts' => 'model/vnd.mts',
            // 'obj' => 'model/obj',
            // 'ogex' => 'model/vnd.opengex',
            // 'silo' => 'model/mesh',
            // 'stl' => 'model/stl',
            // '3mf' => 'model/3mf',
            // 'bsp' => 'model/vnd.valve.source.compiled-map',
            // 'wrl' => 'model/vrml',
            // 'x3d' => 'model/x3d+xml',
            // 'x3db' => 'model/x3d+fastinfoset',
            // 'x3dbz' => 'model/x3d+binary',
            // 'x3dv' => 'model/x3d-vrml',
            // 'x3dvz' => 'model/x3d+vrml',
            // 'x3dz' => 'model/x3d+xml',
            // 'x_b' => 'model/vnd.parasolid.transmit.binary',
            // 'x_t' => 'model/vnd.parasolid.transmit.text',
            // 'dae' => 'model/vnd.collada+xml',
            // 'dwf' => 'model/vnd.dwf',
            // 'vtu' => 'model/vnd.vtu',
            // 'usdz' => 'model/vnd.usdz+zip',
            // 'vrml' => 'model/vrml',
            // 'gdl' => 'model/vnd.gdl',
            // 'glb' => 'model/gltf-binary',
            // 'gltf' => 'model/gltf+json',
            // 'gtw' => 'model/vnd.gtw',
            // 'igs' => 'model/iges',
            // 'iges' => 'model/iges',
            // 'mesh' => 'model/mesh',

            // text
            'html' => 'text/html',
            'htm' => 'text/html',
            'shtml' => 'text/html',
            'css' => 'text/css',
            'js' => 'text/javascript',
            'jsm' => 'text/javascript',
            'mjs' => 'text/javascript',
            // 'xml' => 'text/xml', // in favor of application/xml
            'mml' => 'text/mathml',
            'txt' => 'text/plain',
            'jad' => 'text/vnd.sun.j2me.app-descriptor',
            'wml' => 'text/vnd.wap.wml',
            'htc' => 'text/x-component',

            // 其它，用到时解开退隐条路的注释，不要全部解开了
            // 'ms' => 'text/troff',
            // 'n3' => 'text/n3',
            // 'nfo' => 'text/x-nfo',
            // 'opml' => 'text/x-opml',
            // 'p' => 'text/x-pascal',
            // 'pas' => 'text/x-pascal',
            // 'pde' => 'text/x-processing',
            // 'roff' => 'text/troff',
            // 'rtx' => 'text/richtext',
            // 's' => 'text/x-asm',
            // 'sass' => 'text/x-sass',
            // 'scss' => 'text/x-scss',
            // 'scurl' => 'text/vnd.curl.scurl',
            // 'sfv' => 'text/x-sfv',
            // 'sgm' => 'text/sgml',
            // 'sgml' => 'text/sgml',
            // 'shex' => 'text/shex',
            // 'slim' => 'text/slim',
            // 'slm' => 'text/slim',
            // 'spdx' => 'text/spdx',
            // 'spot' => 'text/vnd.in3d.spot',
            // 'styl' => 'text/stylus',
            // 'stylus' => 'text/stylus',
            // 'sub' => 'text/vnd.dvb.subtitle',
            // 'text' => 'text/plain',
            // 'tr' => 'text/troff',
            // 'tsv' => 'text/tab-separated-values',
            // 'ttl' => 'text/turtle',
            // 'yml' => 'text/yaml',
            // 'ymp' => 'text/x-suse-ymp',
            // 'yaml' => 'text/yaml',
            // '3dml' => 'text/vnd.in3d.3dml',
            // 'appcache' => 'text/cache-manifest',
            // 'asm' => 'text/x-asm',
            // 'c' => 'text/x-c',
            // 'cc' => 'text/x-c',
            // 'coffee' => 'text/coffeescript',
            // 'conf' => 'text/plain',
            // 'cpp' => 'text/x-c',
            // 'wmls' => 'text/vnd.wap.wmlscript',
            // 'csv' => 'text/csv',
            // 'curl' => 'text/vnd.curl',
            // 'cxx' => 'text/x-c',
            // 'dcurl' => 'text/vnd.curl.dcurl',
            // 'def' => 'text/plain',
            // 'dic' => 'text/x-c',
            // 'dsc' => 'text/prs.lines.tag',
            // 'etx' => 'text/x-setext',
            // 't' => 'text/troff',
            // 'vtt' => 'text/vtt',
            // 'uri' => 'text/uri-list',
            // 'uris' => 'text/uri-list',
            // 'urls' => 'text/uri-list',
            // 'uu' => 'text/x-uuencode',
            // 'vcard' => 'text/vcard',
            // 'vcf' => 'text/x-vcard',
            // 'vcs' => 'text/x-vcalendar',
            // 'f' => 'text/x-fortran',
            // 'f77' => 'text/x-fortran',
            // 'f90' => 'text/x-fortran',
            // 'for' => 'text/x-fortran',
            // 'flx' => 'text/vnd.fmi.flexstor',
            // 'fly' => 'text/vnd.fly',
            // 'hh' => 'text/x-c',
            // 'gv' => 'text/vnd.graphviz',
            // 'hbs' => 'text/x-handlebars-template',
            // 'h' => 'text/x-c',
            // 'ics' => 'text/calendar',
            // 'ifb' => 'text/calendar',
            // 'in' => 'text/plain',
            // 'ini' => 'text/plain',
            // 'jade' => 'text/jade',
            // 'java' => 'text/x-java-source',
            // 'jsx' => 'text/jsx',
            // 'less' => 'text/less',
            // 'list' => 'text/plain',
            // 'litcoffee' => 'text/coffeescript',
            // 'log' => 'text/plain',
            // 'lua' => 'text/x-lua',
            // 'man' => 'text/troff',
            // 'manifest' => 'text/cache-manifest',
            // 'markdown' => 'text/markdown',
            // 'mcurl' => 'text/vnd.curl.mcurl',
            // 'md' => 'text/markdown',
            // 'mdx' => 'text/mdx',
            // 'me' => 'text/troff',
            // 'mkd' => 'text/x-markdown',

            // video
            '3gpp' => 'video/3gpp',
            '3gp' => 'video/3gpp',
            'ts' => 'video/mp2t',
            'mp4' => 'video/mp4',
            'mpeg' => 'video/mpeg',
            'mpg' => 'video/mpeg',
            'mov' => 'video/quicktime',
            'webm' => 'video/webm',
            'flv' => 'video/x-flv',
            'm4v' => 'video/x-m4v',
            'mng' => 'video/x-mng',
            'asx' => 'video/x-ms-asf',
            'asf' => 'video/x-ms-asf',
            'wmv' => 'video/x-ms-wmv',
            'avi' => 'video/x-msvideo',

            // 其它，用到时解开退隐条路的注释，不要全部解开了
            // 'movie' => 'video/x-sgi-movie',
            // 'mp4v' => 'video/mp4',
            // 'mpe' => 'video/mpeg',
            // 'mpg4' => 'video/mp4',
            // 'mxu' => 'video/vnd.mpegurl',
            // 'ogv' => 'video/ogg',
            // 'pyv' => 'video/vnd.ms-playready.media.pyv',
            // 'qt' => 'video/quicktime',
            // 'smv' => 'video/x-smv',
            // '3g2' => 'video/3gpp2',
            // 'wvx' => 'video/x-ms-wvx',
            // 'wm' => 'video/x-ms-wm',
            // 'wmx' => 'video/x-ms-wmx',
            // 'dvb' => 'video/vnd.dvb.file',
            // 'uvh' => 'video/vnd.dece.hd',
            // 'uvm' => 'video/vnd.dece.mobile',
            // 'uvp' => 'video/vnd.dece.pd',
            // 'uvs' => 'video/vnd.dece.sd',
            // 'uvu' => 'video/vnd.uvvu.mp4',
            // 'uvv' => 'video/vnd.dece.video',
            // 'uvvh' => 'video/vnd.dece.hd',
            // 'uvvm' => 'video/vnd.dece.mobile',
            // 'uvvp' => 'video/vnd.dece.pd',
            // 'uvvs' => 'video/vnd.dece.sd',
            // 'viv' => 'video/vnd.vivo',
            // 'vob' => 'video/x-ms-vob',
            // 'uvvu' => 'video/vnd.uvvu.mp4',
            // 'uvvv' => 'video/vnd.dece.video',
            // 'f4v' => 'video/x-f4v',
            // 'fli' => 'video/x-fli',
            // 'fvt' => 'video/vnd.fvt',
            // 'h261' => 'video/h261',
            // 'h263' => 'video/h263',
            // 'h264' => 'video/h264',
            // 'jpgm' => 'video/jpm',
            // 'jpgv' => 'video/jpeg',
            // 'm1v' => 'video/mpeg',
            // 'm2v' => 'video/mpeg',
            // 'm4u' => 'video/vnd.mpegurl',
            // 'mj2' => 'video/mj2',
            // 'mjp2' => 'video/mj2',
            // 'mk3d' => 'video/x-matroska',
            // 'mks' => 'video/x-matroska',
            // 'mkv' => 'video/x-matroska',

            // message
            // 其它，用到时解开退隐条路的注释，不要全部解开了
            // 'u8dsn' => 'message/global-delivery-status',
            // 'u8hdr' => 'message/global-headers',
            // 'u8mdn' => 'message/global-disposition-notification',
            // 'u8msg' => 'message/global',
            // 'wsc' => 'message/vnd.wfa.wsc',
            // 'disposition-notification' => 'message/disposition-notification',
            // 'eml' => 'message/rfc822',
            // 'mime' => 'message/rfc822',

            // multipart
        ];
    }
}